package br.com.siscob.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@Table(name="funcionario")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class CadFuncionario extends Pessoa implements Serializable{
	
	@Id
	@GeneratedValue
	private int codFuncionario;
	@Column(length=30)
	private String formacao;
	private Double salario;	
	@Temporal(TemporalType.DATE)
	private Date dataAdmissao;
	@Temporal(TemporalType.DATE)
	private Date dataDemissao;
	@Column(length=30)
	private String cargo;
	@OneToMany(mappedBy="funcionario")
	@Cascade(CascadeType.ALL)
	private Collection<Contato> contato;
	
	
	public CadFuncionario() {
	}


	public int getCodFuncionario() {
		return codFuncionario;
	}


	public void setCodFuncionario(int codFuncionario) {
		this.codFuncionario = codFuncionario;
	}


	public String getFormacao() {
		return formacao;
	}


	public void setFormacao(String formacao) {
		this.formacao = formacao;
	}


	public Double getSalario() {
		return salario;
	}


	public void setSalario(Double salario) {
		this.salario = salario;
	}


	public Date getDataAdmissao() {
		return dataAdmissao;
	}


	public void setDataAdmissao(Date dataAdmissao) {
		this.dataAdmissao = dataAdmissao;
	}


	public Date getDataDemissao() {
		return dataDemissao;
	}


	public void setDataDemissao(Date dataDemissao) {
		this.dataDemissao = dataDemissao;
	}


	public String getCargo() {
		return cargo;
	}


	public void setCargo(String cargo) {
		this.cargo = cargo;
	}


	public Collection<Contato> getContato() {
		return contato;
	}


	public void setContato(Collection<Contato> contato) {
		this.contato = contato;
	}
}